package com.acmen.easyapi.model;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

public class Cell implements Serializable {
    public final static String ALIGN_LEFT = "left";
    public final static String ALIGN_RIGHT = "right";
    public final static String ALIGN_CENTER = "center";

    public final static String VALIGN_LEFT = "top";
    public final static String VALIGN_RIGHT = "bottom";
    public final static String VALIGN_CENTER = "middle";

    private String id;
    private int colspan = 1;
    private int rowspan = 1;
    private String align = ALIGN_CENTER;
    private String valign;
    private Object value;//内容
    private String style;
    private String pattern;
    private String href;
    private Map context = new HashMap();

    public Cell() {

    }

    public Cell(Object value) {
        this.value = value;
    }

    public String getId() {
        return this.id;
    }

    public int getColspan() {
        return this.colspan;
    }

    public int getRowspan() {
        return this.rowspan;
    }

    public String getAlign() {
        return this.align;
    }

    public String getValign() {
        return this.valign;
    }

    public Object getValue() {
        return this.value;
    }

    public String getStyle() {
        return this.style;
    }

    public String getPattern() {
        return this.pattern;
    }

    public String getHref() {
        return this.href;
    }

    public Map getContext() {
        return this.context;
    }

    public void setId(String id) {
        this.id = id;
    }

    public void setColspan(int colspan) {
        this.colspan = colspan;
    }

    public void setRowspan(int rowspan) {
        this.rowspan = rowspan;
    }

    public void setAlign(String align) {
        this.align = align;
    }

    public void setValign(String valign) {
        this.valign = valign;
    }

    public void setValue(Object value) {
        this.value = value;
    }

    public void setStyle(String style) {
        this.style = style;
    }

    public void setPattern(String pattern) {
        this.pattern = pattern;
    }

    public void setHref(String href) {
        this.href = href;
    }

    public void setContext(Map context) {
        this.context = context;
    }
    @Override
    public boolean equals(final Object o) {
        if (o == this) return true;
        if (!(o instanceof Cell)) return false;
        final Cell other = (Cell) o;
        if (!other.canEqual((Object) this)) return false;
        final Object this$id = this.getId();
        final Object other$id = other.getId();
        if (this$id == null ? other$id != null : !this$id.equals(other$id)) return false;
        if (this.getColspan() != other.getColspan()) return false;
        if (this.getRowspan() != other.getRowspan()) return false;
        final Object this$align = this.getAlign();
        final Object other$align = other.getAlign();
        if (this$align == null ? other$align != null : !this$align.equals(other$align)) return false;
        final Object this$valign = this.getValign();
        final Object other$valign = other.getValign();
        if (this$valign == null ? other$valign != null : !this$valign.equals(other$valign)) return false;
        final Object this$value = this.getValue();
        final Object other$value = other.getValue();
        if (this$value == null ? other$value != null : !this$value.equals(other$value)) return false;
        final Object this$style = this.getStyle();
        final Object other$style = other.getStyle();
        if (this$style == null ? other$style != null : !this$style.equals(other$style)) return false;
        final Object this$pattern = this.getPattern();
        final Object other$pattern = other.getPattern();
        if (this$pattern == null ? other$pattern != null : !this$pattern.equals(other$pattern)) return false;
        final Object this$href = this.getHref();
        final Object other$href = other.getHref();
        if (this$href == null ? other$href != null : !this$href.equals(other$href)) return false;
        final Object this$context = this.getContext();
        final Object other$context = other.getContext();
        if (this$context == null ? other$context != null : !this$context.equals(other$context)) return false;
        return true;
    }

    protected boolean canEqual(final Object other) {
        return other instanceof Cell;
    }
    @Override
    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        final Object $id = this.getId();
        result = result * PRIME + ($id == null ? 43 : $id.hashCode());
        result = result * PRIME + this.getColspan();
        result = result * PRIME + this.getRowspan();
        final Object $align = this.getAlign();
        result = result * PRIME + ($align == null ? 43 : $align.hashCode());
        final Object $valign = this.getValign();
        result = result * PRIME + ($valign == null ? 43 : $valign.hashCode());
        final Object $value = this.getValue();
        result = result * PRIME + ($value == null ? 43 : $value.hashCode());
        final Object $style = this.getStyle();
        result = result * PRIME + ($style == null ? 43 : $style.hashCode());
        final Object $pattern = this.getPattern();
        result = result * PRIME + ($pattern == null ? 43 : $pattern.hashCode());
        final Object $href = this.getHref();
        result = result * PRIME + ($href == null ? 43 : $href.hashCode());
        final Object $context = this.getContext();
        result = result * PRIME + ($context == null ? 43 : $context.hashCode());
        return result;
    }
    @Override
    public String toString() {
        return "Cell(id=" + this.getId() + ", colspan=" + this.getColspan() + ", rowspan=" + this.getRowspan() + ", align=" + this.getAlign() + ", valign=" + this.getValign() + ", value=" + this.getValue() + ", style=" + this.getStyle() + ", pattern=" + this.getPattern() + ", href=" + this.getHref() + ", context=" + this.getContext() + ")";
    }
}
